The present invention relates to an electronic circuit, electronic apparatus and method for elimination metastability.
In digital integrated circuits, there is a need for synchronization of signals when transmitting signals between asynchronous clock domains. If the signals are not synchronized, and the setup and hold time of a flip-flop is not met, the output of the flip-flop may be in a metastable state. In this case, the output Q of the flip-flop may be in an indefinite state for a relatively long period of time after the active clock edge, the output Q of the flip-flop may have glitches, oscillation or an undefined voltage value, instead of being equal to the value of the signal at the input D of the flip-flop.
Since the metastable state of a flip-flop may affect greatly the correct function of a digital circuit, there is a need to eliminate the metastable state so that signals across different clock domains can be sampled correctly.
Some techniques have been proposed to solve the problems of metastability, however, they have some limitations and are not reliable. FIG. 1 is a conventional circuit that is commonly used for solving the problems of metastability, as known in the prior art. The circuit includes two flip-flops that are connected sequentially and can cause metastability to die out between them. However, the sequentially connected flip-flops can reduce but not completely eliminate metastability.
As is described above, the prior art circuit cannot completely eliminate the problems of metastability when a data signal from one clock domain (denoted “first clock domain”), driven by a first local clock signal (denoted “CLK1”) is sent to another clock domain (denoted “second clock domain”) having a second clock signal (denoted “CLK2”), problems of metastability may occur when the transition of the data signal takes place during the active edge of the second clock signal, i.e., the data signal cannot be correctly sampled and the output value of the receiving flip-flop cannot be relied upon. Therefore, there is a need for a novel electronic circuit, apparatus, and method that can completely eliminates metastability.